<template>
    <RouterView />
</template>

<script setup lang="ts">
import { useSidebarStore } from '@/store/sidebar';

const sidebarStore = useSidebarStore();

// 检测屏幕尺寸
const checkScreenSize = () => {
    sidebarStore.setMobile(window.innerWidth < 768);
};

onMounted(() => {
    checkScreenSize();
    window.addEventListener('resize', checkScreenSize);
});

onBeforeUnmount(() => {
    window.removeEventListener('resize', checkScreenSize);
});
</script>
